home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / Newton Sample Code 1.1 / Routing / The Little Prints-4 / Project Data < prev    next >
Encoding:
Text File  |  1994-02-28  |  924 b   |  32 lines  |  [TEXT/ttxt]

  1. // Copyright ©1993-94 Apple Computer, Inc. All rights reserved.
  2.  
  3. // declare some useful constants
  4. constant kAppSymbol := '|littlePrints:PIEDTS| ;
  5. constant kBorderFormat := '|borderFormat:littlePrints:PIEDTS| ;
  6.  
  7.  
  8. // run at application install time
  9. // setup stuff the app may need before it is ever opened
  10. // or opened for this restart :-)
  11. InstallScript := func(partFrame)
  12. begin
  13.    local myApp := partFrame.theForm ;
  14.  
  15.    // put my routing frame in the global routing frame
  16.    routing.(kAppSymbol) := myApp.myRoutingFrame ;
  17.  
  18.    // put my format in the root so it can be found
  19.    GetRoot().(kBorderFormat) := BuildContext(myApp.myPrintFormat);
  20. end;
  21.  
  22.  
  23. // run when application and/or card with app removed
  24. // cleanup routing stuff
  25. RemoveScript := func(packageFrame)
  26. begin
  27.    // get rid of entry in global routing frame
  28.    RemoveSlot(routing, kAppSymbol);
  29.  
  30.    // remove my print format
  31.    RemoveSlot(GetRoot(), kBorderFormat);
  32. end;